import axios  from '../config'
import { PROJECT_API_URL } from '../baseURL'

export default {
    //获取所有音频信息
    getAudio(){
      return axios({
          url: PROJECT_API_URL + '/audio/list',
          method: "GET",
      })
    },

    //
    selectAudio(data){
      return axios({
        url: PROJECT_API_URL + '/oss/audios',
        method: "POST",
        data: data
      })
    },
    getEmotionAudio(){
      return axios({
        url: PROJECT_API_URL + '/audio/emotion/list',
        method: "GET",
      })
    },
    updateEmotionAudio(data){
      return axios({
        url: PROJECT_API_URL + '/audio/update/emotion',
        method: "POST",
        data: data
      })
    },
    getCollectType(){
      return axios({
        url: PROJECT_API_URL + '/collect/get/type',
        method: "GET",
      })
    },
    insertCollectType(data){
      return axios({
        url: PROJECT_API_URL + '/collect/insert/type',
        method: "POST",
        data: data
      })
    },
    deleteCollectType(cid){
      return axios({
        url: PROJECT_API_URL + '/collect/delete/type',
        method: "GET",
        params:{
          cid:cid
        }
      })
    },
    uploadEmotionFile(){
      return  PROJECT_API_URL + '/audio/emotion/upload'
    },

    fileUploadHistory(data){
      return axios({
        url: PROJECT_API_URL+ '/file/upload/history',
        method: "POST",
        data: data
      })
    },

    // /emotion/history
    getEmotionHistory(type){
      return axios({
        url: PROJECT_API_URL+ '/file/emotion/history',
        method: "GET",
        params:{
          discernType:type
        }
      })
    },

    deleteHistoryFile(fid){
      return axios({
        url: PROJECT_API_URL + '/file/delete/history/one',
        method: 'GET',
        params:{
          fid:fid
        }
      })
    },

    deleteHistoryAll(){
      return axios({
        url: PROJECT_API_URL + '/file/delete/history/all',
        method: 'GET',
        
      })
    },
    //批量下载
    // downloads(data){
    //   return axios({
    //     url: PROJECT_API_URL + '/oss/downloads',
    //     // method: "GET",
    //     // method: "POST",
    //     // data: data
    //   })
    // }
    
}